import Router from 'koa-router';
import AiUser from "../../controller/aiuser";

const router = new Router();

router.prefix('/api/aiuser');

router
  /**
   * @swagger
   * /api/aiuser/creted:
   *   post: 
   *     description: 提交注册 || 登陆 
   *     tags: [AI用户] 
   *     summary: "提交注册 || 登陆 "
   *     parameters:
   *           - in: body
   *             name: phone
   *             description: 手机号
   *             required: true
   *             type: string
   *             default: 13812345678
   *           - in: body
   *             name: code
   *             description: 验证码
   *             required: true
   *             type: string
   *             default: 123456
   *     produces: 
   *       - application/json 
   *     responses: 
   *       200:
   *         description: 获取数据列表 
   * */
  .post('/creted', AiUser.creted)
  /**
  * @swagger
  * /api/aiuser/code:
  *   get: 
  *     description: 获取验证码 用于登陆注册
  *     tags: [AI用户] 
  *     summary: "获取验证码"
  *     parameters:
  *             - in: query
  *               name: phone
  *               description: 手机号
  *               required: true
  *               type: string
  *               default: 13812345678
  *     produces: 
  *       - application/json 
  *     responses: 
  *       200:
  *         description: 获取数据列表 
  * */
  .get('/code', AiUser.code)
  /**
  * @swagger
  * /api/aiuser/bindShop:
  *   get: 
  *     description: 绑定店铺
  *     tags: [AI用户] 
  *     summary: "绑定店铺"
  *     parameters:
  *             - in: query
  *               name: shop_id
  *               description: 店铺id
  *               required: true
  *               type: string
  *               default: 1234567
  *     produces: 
  *       - application/json 
  *     responses: 
  *       200:
  *         description: 获取数据列表 
  * */
  .get('/bindShop', AiUser.bindShop)
  /**
  * @swagger
  * /api/aiuser/userinfo:
  *   get: 
  *     description: 获取用户信息
  *     tags: [AI用户] 
  *     summary: "获取用户信息"
  *     parameters:
  *     produces: 
  *       - application/json 
  *     responses: 
  *       200:
  *         description: 获取数据列表 
  * */
  .get('/userinfo', AiUser.userinfo)
  /**
  * @swagger
  * /api/aiuser/bindinfo:
  *   get: 
  *     description: 检查绑定信息
  *     tags: [AI用户] 
  *     summary: "检查绑定信息"
  *     parameters:
  *             - in: query
  *               name: shop_id
  *               description: 店铺id
  *               required: false
  *               type: string
  *               default: 为空获取所有绑定店铺
  *     produces: 
  *       - application/json 
  *     responses: 
  *       200:
  *         description: 获取数据列表 
  * */
  .get('/bindinfo', AiUser.bindinfo)
  /**
  * @swagger
  * /api/aiuser/unbindShop/:shop_id:
  *   put: 
  *     description: 解绑店铺
  *     tags: [AI用户] 
  *     summary: "解绑店铺"
  *     parameters:
  *             - in: query
  *               name: shop_id
  *               description: 店铺id
  *               required: false
  *               type: string
  *               default: 为空获取所有绑定店铺
  *     produces: 
  *       - application/json 
  *     responses: 
  *       200:
  *         description: 获取数据列表 
  * */
  .put('/unbindShop/:shop_id', AiUser.unbindShop)
  /**
  * @swagger
  * /api/aiuser/refreshLogin:
  *   post: 
  *     description: 刷新token
  *     tags: [AI用户] 
  *     summary: "刷新token"
  *     parameters:
  *             - in: body
  *               name: refresh_token
  *               description: 刷新令牌
  *               required: true
  *               type: string
  *     produces: 
  *       - application/json 
  *     responses: 
  *       200:
  *         description: 获取数据列表 
  * */
  .post('/refreshLogin', AiUser.refreshLogin)


export default router;